angular.module('${menuCode}')
.controller("${widgetCode}Ctrl",function($scope,AppKit){
	var url = '/portal/resource?MobileInformationsDataProvider&actionType=getKnowledgeInformation&ID='+$scope.currentInfoId;
	var promise = AppKit.getJsonApi(url);
	promise.success(function(rspJson){
		$scope.id = rspJson.id;
		$scope.title = rspJson.title;
		$scope.createTime = rspJson.createTime;
		$scope.content = rspJson.content;
	});
	
	$scope.praiseInfo = {"infoId":$scope.currentInfoId};
	$scope.doPraise = function(){
		var url = "/portal/resource?WcmInfomationEdit&actionType=mobileIncreaseInfoPraise"
		AppKit.postJsonApi(url,$scope.praiseInfo).then(function(response){
			if ("success" == response.data){
				AppKit.successPopup();				
			}else{
				AppKit.errorPopup();
			}
		});
	}
	
	$scope.favoriteInfo = {"infoId":$scope.currentInfoId,"title":"123","favType":"OTHERS"};
	$scope.doFavorite = function(){
		var url = "/portal/resource?InfomationFavEdit&actionType=mobileAddToFavorite"
		AppKit.postJsonApi(url,$scope.favoriteInfo).then(function(response){
			if ("success" == response.data){
				AppKit.successPopup();				
			}else{
				AppKit.errorPopup();
			}
		});
	}
});